package org.stu.tp.testCases.userInfo;

import org.stu.tp.core.DefaultTestCase;
import org.stu.tp.dao.UserDao;
import org.stu.tp.dto.User;


public class TestUserInfo extends DefaultTestCase{
	UserInfoAction userAC=new UserInfoAction();
	
	
	/**
	 * @throws Exception
	 * Edit password, email and address
	 */
	public void testEditUsual()throws Exception{
		User user=UserDao.getUser("user1");
		User client=new User();
		
		userAC.loginByDefault(this.getSelenium());
		userAC.accessUserInfo(this.selenium);
		userAC.setAllInfo(this.getSelenium(), user);
		userAC.clickAtSaveButton(this.getSelenium());
		Thread.sleep(3000);
		
//		restart selenium to negative the javaScript
		this.restartSelenium();
		
//		check the edit
		userAC.loginByDefault(this.getSelenium());
		userAC.accessUserInfo(this.selenium);
		userAC.getAllInfo(this.getSelenium(), client);
		user.getLoginId().equals(client.getLoginId());
		user.getEmail().equals(client.getEmail());
	}
	
}
